package com.patterns.mediator;

/**
 * 财务部
 * @author huangke
 *
 */
public class FinacialDepartment implements Department{
	
	private Mediator mediator;//持有中介者（总经理）的引用
	
	public FinacialDepartment(Mediator mediator) {
		this.mediator = mediator;
		mediator.register("finacial", this);//向中介者注册
	}

	public void selfAction() {
		System.out.println("财务部:发钱喽");
	}

	public void outerAction() {
		System.out.println("财务部:公司没钱了!");
		this.mediator.command("market");
	}

}
